from ..common.ui.PageElement import PageElement


class PopEdit(PageElement):
    '''
    fish desktop Popedit组件
    https://fish.iwhalecloud.com/fish-desktop/examples/popedit/index.html
    '''

    def click(self):
        self.wait_element_ready()
        script = "$(arguments[0]).nextAll('.input-group-addon').click()"
        self._execute_script(script, self._get_web_element())

    def get_identification(self):
        identification = {'class': ['form-control'],
                          'data-ui-role': ['popedit']}
        return identification

